package cc.wsyw126.java.jvm;

/**
 * Created by junpeng.yang on 17/3/20.
 */
public class lowThanOneByte {
    //JVM中一个字节以下的整型数据会在JVM启动的时候加载进内存，除非用new Integer()显式的创建对象，否则都是同一个对象.
    public static void main(String[] args) {
        Integer a = 2;
        Integer b = 2;
        System.out.println("(b == a) = " + (b == a));
        Integer c = new Integer(2);
        System.out.println("(b == c) = " + (b == c));
        System.out.println("(b == c) = " + (b == a.intValue()));
        //和基本类型比较时,转换为基本类型 故输出true
    }
}
